<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let arr = []
        let sum = 0
        let average = 0
        let max = 0
        let min = 0
        for (let i = 0; i <= 4; i++) {
            let age = +prompt('请输入一个0-100的年龄')
            if (age >= 0 && age <= 100) {
                arr.push(age)
            }
            console.log(arr[i])
        }
        for (i = 0; i <= 4; i++) {
            sum += arr[i]

        }
        console.log(`年龄总和为：${sum}`)
        console.log(`年龄平均值为：${sum / arr.length}`)
        for (i = 0; i < arr.length; i++) {
            if (max < arr[i]) {
                max = arr[i];

            }
            if (min > arr[i]) {
                min = arr[i];

            }

        }
        console.log(`最大值是：${max}`);
        console.log(`最小值是：${min}`);
    </script>
</body>

</html>